# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test07
# Description:  为类添加两个方法分别用于监控读写value属性值
# Author:       ASUS
# Date:         2019/3/19
#-------------------------------------------------------------------------------


class Myclass:
    def __init__(self):
        self.value = 0

    def getValue(self):
        print("value属性的值已经被读取")
        return self.value

    def setValue(self,value):
        print("Value属性的值已经被修改")
        self.value = value


c =Myclass()
c.value = 20                            #直接设置value属性值
c.setValue(100)                         #通过setValue方法设置value属性的值
print("getValue:",c.getValue())
print('value:',c.value)

